package com.fwmagic.flink.batch

import org.apache.flink.api.java.tuple.Tuple
import org.apache.flink.streaming.api.scala.{DataStream, KeyedStream, StreamExecutionEnvironment}
import org.apache.flink.api.scala._

object BatchTest {

  def main(args: Array[String]): Unit = {
    //val env: StreamExecutionEnvironment = StreamExecutionEnvironment.getExecutionEnvironment
    //val env: ExecutionEnvironment = ExecutionEnvironment.getExecutionEnvironment
   /* val dataStream: DataStream[(Int, Int)] = env.fromElements((1,5),(2,2),(2,4),(1,3))
    val keyedStream = dataStream.keyBy(_._1).countWindow(1)
    keyedStream.sum(1).print()
    env.execute("test")*/
    val env = StreamExecutionEnvironment.getExecutionEnvironment

   /* val dataStream: DataStream[(String, Int)] = env.fromElements(("a",3),("d",4),("c",2),("c",5),("a",5))
    val keyedStream: KeyedStream[(String, Int), Tuple] = dataStream.keyBy(0)
    val reduceStream: DataStream[(String, Int)] = keyedStream.reduce((t1,t2) => (t1._1,t1._2+t2._2))
    reduceStream.print()
*/
    env.execute()

  }

}
